<template>
	<div class="animate-positiona">		
		<div class="page has-navbar has-tabbar" v-nav="{title: '跟进历史', showBackButton: true}">
			<div class="page-content padding-top" style="margin-bottom: 0">
				<div class="car-editor" ref="carEditor">
					<div class="reserve">
						<ul>
							<li>
								<div class="car-editor-title">
									跟进历史
									<!-- <div class="car-editor-title-right">
										到店2次
									</div> -->
								</div>
								<list>
									<item>
										<div class="car-editor-cus table">
											<table class="car-editor-table">
												<tr v-for="item in res">
													<td>
														<div class="car-editor-info-state" :data-state="item.followState">{{item.followState | filterFollowHistory}}</div>
													</td>
													<td>
														<div class="car-editor-info-date">
															<p v-if="item.followState == 10">{{String(item.nextFollowTime||'').slice(0,10)}}</p>
															<p v-if="item.followState == 20">{{String(item.appointmentTime||'').slice(0,10)}}</p>
															<p v-if="item.followState == 30">{{String(item.loseEfficacyTime||'').slice(0,10)}}</p>
															<p v-if="item.followState == 40">{{String(item.loseEfficacyTime||'').slice(0,10)}}</p>
															<p v-if="item.followState == 50">{{String(item.fixtureTime||'').slice(0,10)}}</p>
															<p>{{item.followRemark}}</p>															
														</div>
														<div class="car-editor-section" v-if="item.followState==50">
															<div class="car-editor-section-list">
																<div class="car-editor-section-item">
																	<div class="car-editor-section-img">
																		<img :src="imgUrl+item.fixtureCarPic" onerror="javascript:this.src='static/images/default.png';" />
																	</div>
																	<div class="car-editor-section-txt">
																		<h5>{{item.fixtureCar}}</h5>
																		<span>¥{{item.fixturePrice}}万</span>
																	</div>
																</div>
															</div>
														</div>
														<div class="car-editor-info-date">
															<p>跟进人：{{item.followName}} </p>
														</div>
													</td>
												</tr>
												
											</table>
										</div>
									</item>
								</list>
							</li>
						</ul>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	import { swiper, swiperSlide } from 'vue-awesome-swiper'
	import 'src/assets/css/swiper.min.css'
	export default{
		data(){
			return {
				imgUrl:imgUrl,
				
				res:[]
			}
		},
		components:{
			swiper,
			swiperSlide
		},
		methods:{
			getData(){
				axios.get(baseUrl+'/crm-web/controller/customer/followHistory',{params:{
					customerShopId:this.$route.query.params.customerShopId
				}}).then((res)=>{
					console.log(res)
					this.res = res.data.result
				})
			}
		},
		mounted(){
			this.getData()
		}
	}
</script>